package lazy.multithreading;

import java.util.Scanner;

/**
 * @Description
 * @Author zhousl
 * @Date 2023/4/3 23:10
 */
public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] sum = new int[n];
        for(int i=0;i<n;i++){
            sum[i] = scanner.nextInt();
        }

        int[][][] dp = new int[n][m+1][5];
        int res=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m+1;j++){
                for(int k=0;k<=Math.min(4,j);k++){
                    if(i==0){
                        if(k==0){
                            dp[i][j][k] = (int) (sum[i]*0.2);
                        }else{
                            dp[i][j][k] = (int) (sum[i]*(1+0.1*(k-1)));
                        }
                    }else {
                        int val=-1;
                        for(int t=0;t<5;t++){
                            val = Math.max(val,dp[i-1][j-k][t]);
                        }
                        if(k==0){
                            dp[i][j][k] = (int) (val+sum[i]*0.2);
                        }else {
                            dp[i][j][k] = (int) (val+sum[i]*(1+0.1*(k-1)));
                        }
                    }
                    res = Math.max(res,dp[i][j][k]);
                }
            }
        }

        System.out.println(res);
    }
}
